Skip to content

workflow: add auto-draft#1855

Closed
shinokada wants to merge 3 commits intothemesberg:mainfrom
shinokada:auto-draft
Closed

workflow: add auto-draft#1855
shinokada wants to merge 3 commits intothemesberg:mainfrom
shinokada:auto-draft

Conversation

@shinokada
Copy link
Collaborator

@shinokada shinokada commented Nov 25, 2025

🔗 Related issue (optional)

Closes #


📑 Description


🔍 PR Type

  • Bug fix
  • Feature
  • Documentation
  • Refactor / Code cleanup
  • Build / Tooling
  • Other (please describe)

🚦 PR Status

  • Draft (work in progress, not ready for review)
  • Ready for review ✅

✅ Checklist

  • My code follows the existing code style
  • I have run pnpm lint && pnpm check && pnpm test:e2e and all tests pass
  • CoderabbitAI review has been completed and actionable suggestions were reviewed
  • I have updated documentation if my changes require it
  • My PR is based on the latest main branch (not the published npm version)
  • I have checked accessibility where applicable (ARIA, keyboard nav, etc.)
  • I have reviewed the rendered component in the browser

🧪 Screenshots / Demos (optional)


⚠️ Breaking Changes (optional)


ℹ️ Additional Information

Summary by CodeRabbit

  • Chores
    • Updated repository automation to run on pull request open/reopen events and attempt an automated draft-state adjustment.

Note: This release contains no user-facing changes. The update affects internal development workflow automation only.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Nov 25, 2025

@shinokada is attempting to deploy a commit to the Themesberg Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 25, 2025

Walkthrough

New GitHub Actions workflow added that triggers on pull_request events (opened, reopened) and runs a job which attempts to convert the current PR back to draft using the GitHub CLI command gh pr ready --undo.

Changes

Cohort / File(s) Change Summary
GitHub Actions workflow
/.github/workflows/convert-pr-to-draft.yml
Added new workflow triggered on pull_request (types: opened, reopened); grants pull-requests: write and runs a job on ubuntu-latest that sets GH_TOKEN and executes gh pr ready --undo for the current PR, logging a warning and exiting 0 if the command fails.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant GitHub as GitHub Events
    participant Actions as GitHub Actions Runner
    participant GHCLI as gh (GitHub CLI)
    GitHub->>Actions: pull_request (opened/reopened)
    Actions->>Actions: set GH_TOKEN from GITHUB_TOKEN
    Actions->>GHCLI: gh pr ready --undo --repo ${{ github.repository }} --pull-request ${{ github.event.pull_request.number }}
    alt CLI succeeds
        GHCLI-->>Actions: success (PR converted to draft)
    else CLI fails
        GHCLI-->>Actions: error
        Actions-->>Actions: echo "warning: failed to convert PR to draft" && exit 0
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5–10 minutes

  • Check workflow YAML syntax and indentation.
  • Verify permissions: pull-requests: write is scoped as intended.
  • Confirm gh pr ready --undo and the repo/PR interpolation are correct.
  • Ensure fallback logging/exit behavior is acceptable for the CI policy.

Poem

🐇 I hop in when PRs arrive,

a tiny CLI to keep drafts alive.
With one soft undo the status will shift,
back to a draft — a gentle, swift gift.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is entirely a template with all placeholders unfilled, providing no actual details about the changes, purpose, or status. Fill in the Description section explaining the workflow's purpose, select the PR Type (Build/Tooling), confirm the checklist items, and update the PR Status to indicate readiness for review.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'workflow: add auto-draft' directly describes the main change - adding a new GitHub Actions workflow for auto-drafting PRs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5342b27 and fc51876.

📒 Files selected for processing (1)
  • .github/workflows/convert-pr-to-draft.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/convert-pr-to-draft.yml

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/auto-draft.yml (1)

7-15: Add explicit permissions configuration.

GitHub Actions workflows should declare explicit permissions rather than relying on default scopes. The convert-to-draft action likely requires pull-request write permissions.

Apply this diff to add explicit permissions:

 name: Auto-convert PRs to draft
 
 on:
   pull_request:
     types: [opened, reopened]
 
+permissions:
+  pull-requests: write
+
 jobs:
   convert-to-draft:
     runs-on: ubuntu-latest

This follows the principle of least privilege and makes the workflow's permission requirements explicit.

📜 Review details

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a7cb84e and 4aa9a5c.

📒 Files selected for processing (1)
  • .github/workflows/auto-draft.yml (1 hunks)

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4aa9a5c and 5342b27.

📒 Files selected for processing (1)
  • .github/workflows/convert-pr-to-draft.yml (1 hunks)
🔇 Additional comments (1)
.github/workflows/convert-pr-to-draft.yml (1)

1-18: Clarify the team policy intent; the workflow implementation is correct.

The gh pr ready --undo command is valid and will successfully convert PRs to draft status. However, your review conflates two distinct concerns:

  1. Workflow implementation: The code is syntactically correct, permissions are appropriate, and the command is valid.
  2. Policy documentation: The actual gap is explaining why this auto-draft behavior exists.

If your concern is that this represents an undocumented policy change, request the developer clarify in the PR description whether:

  • This reflects an agreed team policy
  • There's an existing issue or discussion documenting the rationale
  • All PRs should follow this behavior or if exceptions apply

The workflow itself requires no code changes.

@shinokada shinokada closed this Nov 25, 2025
@shinokada shinokada deleted the auto-draft branch December 28, 2025 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant